//
//  GWStatuseCell.m
//  新浪微博
//
//  Created by qianfeng on 16/2/18.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "GWStatuseCell.h"
#import "GWStatuseDetailView.h"
#import "GWStatuseToolBar.h"
#import "GWStatuseFrame.h"
@interface GWStatuseCell ()
@property (nonatomic,weak)GWStatuseDetailView *detailView;
@property (nonatomic,weak)GWStatuseToolBar  *toolBar;
@end
@implementation GWStatuseCell

+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellId =@"statuse";
    GWStatuseCell *cell =[tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell==nil) {
        cell =[[GWStatuseCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];
        
    }
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self =[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //添加微博具体内容
        [self setupDetailView];
        //添加微博工具条
        [self setupToolBar];
        self.backgroundColor =[UIColor clearColor];
    }
    return self;
}
-(void)setupDetailView
{
    GWStatuseDetailView *detailView =[[GWStatuseDetailView alloc]init];
    [self.contentView addSubview:detailView];
    self.detailView =detailView;
}
-(void)setupToolBar
{
    GWStatuseToolBar *toolbar =[[GWStatuseToolBar alloc]init];
    [self.contentView addSubview:toolbar];
    self.toolBar =toolbar;
}

-(void)setStatuseFrame:(GWStatuseFrame *)statuseFrame
{
    _statuseFrame =statuseFrame;
    
    self.detailView.detailStatuseFrame =statuseFrame.detailStatuseFrame;
    
    self.toolBar.frame =statuseFrame.statuseToolBarFrame;
    self.toolBar.statuse =statuseFrame.statuse;
}
@end
